package com.example.feigntest.service;

import com.example.feigntest.config.FeignLogConfguration;
import com.example.feigntest.vo.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by vincent on 2018/5/17.
 */
@Component
@FeignClient(name = "compute-service", fallback = FallBack.class, configuration = FeignLogConfguration.class)
public interface HelloService {
    @RequestMapping("/add")
    public Integer add(@RequestParam(value = "a") Integer a, @RequestParam(value = "b") Integer b);

    @RequestMapping("/hello")
    public  String hello();

    @PostMapping("/sayMyName")
    Map<String, Object> sayMyName(@RequestBody User user);

}
